import com.itheima.service.BookService;
import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.support.AnnotationConfigContextLoaderUtils;

/**
 * @program: Spring_day01_01_IOC入门程序
 * @description: 这是通过Spring配置文件进行配置的，所以第一步要加载配置文件
 * @author: xuejingjing
 * @create: 2021-08-03 15:43
 **/
public class APP {
    public static void main(String[] args) {
        ApplicationContext atc = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookService bookService = (BookService)atc.getBean("bookService");
        UserService userService = (UserService) atc.getBean("userService");
//        userService.save(666); //老师。我
//        int ret = userService.update();
//        System.out.println("app..."+ret);
//        userService.save(1,2);
        bookService.save();
    }
}
